
const target = {
    books: [] ,
    size() {
        return this.books.length ;
    }
}

const handler = {
    set(target,name,value,receiver){
        console.log( receiver );
        return !!( target[ name ] = value ) ;
    },
    get(target,name,receiver){
        console.log( 'receiver: ' + receiver );
        return target[ name ];
    },
    apply( target , thisArg , arguments ){
        console.log( target , thisArg , arguments );
    }
}

const proxy = new Proxy( target , handler );

// 通过 proxy.books 获取的数组是否是一个代理对象？
console.log( proxy.books );
// 通过 proxy.size 获取的函数是否是一个代理对象？
console.log( proxy.size() );